Optimal. Leaf size=47 \[ \log (x+1) (d-e+f-g)-\log (x+2) (d-2 e+4 f-8 g)+x (f-3 g)+\frac {g x^2}{2} \]
________________________________________________________________________________________
Rubi [A] time = 0.07, antiderivative size = 47, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 4, integrand size = 36, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {1586, 1657, 632, 31} \begin {gather*} \log (x+1) (d-e+f-g)-\log (x+2) (d-2 e+4 f-8 g)+x (f-3 g)+\frac {g x^2}{2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 632
Rule 1586
Rule 1657
Rubi steps
\begin {align*} \int \frac {\left (2-3 x+x^2\right ) \left (d+e x+f x^2+g x^3\right )}{4-5 x^2+x^4} \, dx &=\int \frac {d+e x+f x^2+g x^3}{2+3 x+x^2} \, dx\\ &=\int \left (f-3 g+g x+\frac {d-2 f+6 g+(e-3 f+7 g) x}{2+3 x+x^2}\right ) \, dx\\ &=(f-3 g) x+\frac {g x^2}{2}+\int \frac {d-2 f+6 g+(e-3 f+7 g) x}{2+3 x+x^2} \, dx\\ &=(f-3 g) x+\frac {g x^2}{2}-(d-2 e+4 f-8 g) \int \frac {1}{2+x} \, dx+(d-e+f-g) \int \frac {1}{1+x} \, dx\\ &=(f-3 g) x+\frac {g x^2}{2}+(d-e+f-g) \log (1+x)-(d-2 e+4 f-8 g) \log (2+x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.02, size = 44, normalized size = 0.94 \begin {gather*} \log (x+1) (d-e+f-g)-\log (x+2) (d-2 e+4 f-8 g)+f x+\frac {1}{2} g (x-6) x \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [F] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (2-3 x+x^2\right ) \left (d+e x+f x^2+g x^3\right )}{4-5 x^2+x^4} \, dx \end {gather*}
Verification is not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.88, size = 45, normalized size = 0.96 \begin {gather*} \frac {1}{2} \, g x^{2} + {\left (f - 3 \, g\right )} x - {\left (d - 2 \, e + 4 \, f - 8 \, g\right )} \log \left (x + 2\right ) + {\left (d - e + f - g\right )} \log \left (x + 1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.23, size = 49, normalized size = 1.04 \begin {gather*} \frac {1}{2} \, g x^{2} + f x - 3 \, g x - {\left (d + 4 \, f - 8 \, g - 2 \, e\right )} \log \left ({\left | x + 2 \right |}\right ) + {\left (d + f - g - e\right )} \log \left ({\left | x + 1 \right |}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.01, size = 69, normalized size = 1.47 \begin {gather*} \frac {g \,x^{2}}{2}-d \ln \left (x +2\right )+d \ln \left (x +1\right )+2 e \ln \left (x +2\right )-e \ln \left (x +1\right )+f x -4 f \ln \left (x +2\right )+f \ln \left (x +1\right )-3 g x +8 g \ln \left (x +2\right )-g \ln \left (x +1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.45, size = 45, normalized size = 0.96 \begin {gather*} \frac {1}{2} \, g x^{2} + {\left (f - 3 \, g\right )} x - {\left (d - 2 \, e + 4 \, f - 8 \, g\right )} \log \left (x + 2\right ) + {\left (d - e + f - g\right )} \log \left (x + 1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.76, size = 45, normalized size = 0.96 \begin {gather*} \ln \left (x+1\right )\,\left (d-e+f-g\right )+x\,\left (f-3\,g\right )+\frac {g\,x^2}{2}-\ln \left (x+2\right )\,\left (d-2\,e+4\,f-8\,g\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.86, size = 66, normalized size = 1.40 \begin {gather*} \frac {g x^{2}}{2} + x \left (f - 3 g\right ) + \left (- d + 2 e - 4 f + 8 g\right ) \log {\left (x + \frac {4 d - 6 e + 10 f - 18 g}{2 d - 3 e + 5 f - 9 g} \right )} + \left (d - e + f - g\right ) \log {\left (x + 1 \right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________